#pragma once

#include <string>
#include <functional>

namespace yui
{
    using cb_t = std::function<void(int,std::string,uint16_t)>;
    class Task
    {
        public:
        Task()
        {}
        Task(int sock,const std::string&ip,const uint16_t&port,const cb_t&cb)
            :sock_(sock),ip_(ip),port_(port),cb_(cb)
        {}
        void operator()()
        {
            cb_(sock_,ip_,port_);
        }
        private:
            int sock_;
            std::string ip_;
            uint16_t port_;
            cb_t cb_;
    };
}